<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:include page="../include/header.jsp" />
<script type="text/javascript" src="<c:url value='/htmlRes/js/datepicker/jquery.ui.core.js'/>"></script>
<script type="text/javascript" src="<c:url value='/htmlRes/js/datepicker/jquery.ui.datepicker.js'/>"></script>
<script type="text/javaScript">
<!--
	$(document).ready(function(){
		$( "#searchSdate" ).datepicker();
		$( "#searchEdate" ).datepicker();
	});
	
	function searchForm(){
		$('#listForm').attr('action', '<c:url value="/daily/sludge.do"/>');
		$('#listForm').submit();
	}
	function excelDown(listCnt){
		if(listCnt == 0){
			alert('데이터가 없습니다.');
			return;
		}
		$('#listForm').attr('action', '<c:url value="/daily/sludgeExcelDown.do"/>');
		$('#listForm').submit();
	}
-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt" style="">&nbsp;</span>
	<span class="round rt">&nbsp;</span>
	<span class="round lb">&nbsp;</span>
	<span class="round rb">&nbsp;</span>
	<div class="container_area">
		<h2 class="tit_h2">슬러지 처리 현황</h2>
			<jsp:include page="../include/navi.jsp" />
			<span class="ico_print"><a href="#print"  onclick="printPage('<c:url value="/common/printView.do" />');return false;"><img src="/htmlRes/images/ico_print.jpg" alt="인쇄버튼"></a></span>
			<div class="srch_wrap">
				<form name="listForm" id="listForm" method="post" action="<c:url value='/daily/sludge.do'/>">
					<fieldset>
						<legend>키워드 검색 조회 영역</legend>
						<c:if test="${loginSessionInfo.admin }">
						<select id=searchServiceArea name="searchServiceArea" title="현장 검색" onchange="searchForm();">
							<option value="">전체</option>
							<c:forEach var="result" items="${serviceareaList }"  varStatus="status">
								<option value="${result.ssa_area_key }" <c:if test="${result.ssa_area_key eq dailyVO.searchServiceArea}">selected="selected"</c:if>>${result.ssa_area_name }</option>
							</c:forEach>		
						</select>
						</c:if>
						<label for="searchSdate">기간 </label><input type="text" id="searchSdate" name="searchSdate" value="${dailyVO.searchSdate }"/> - <input type="text" id="searchEdate" name="searchEdate" value="${dailyVO.searchEdate }">
						<a href="<c:url value='/daily/sludge.do'/>" onclick="searchForm();return false;" class="btn_srch">검색</a>
						<a href="<c:url value='/daily/sludgeExcelDown.do'/>" onclick="excelDown(${fn:length(resultList) });return false;" class="btn_exceldown">엑셀 다운로드</a>
					</fieldset>
				</form>
			</div>
			 <div class="table_wrap">
				<table summary="슬러지 처리 현황 테이블 입니다" class="table_list">
					<caption>슬러지 처리 현황</caption>
					<colgroup> <!-- D : col width로 테이블 넓이 조절 -->
						<col span="4" width="25%" />
					</colgroup>
                        <thead>
                            <tr>
                                <th scope="col">날짜</th>
                                <th scope="col">용량</th>
                                <th scope="col">업체명</th>
                                <th scope="col">금액</th>
                            </tr>
                        </thead>
					<tbody>
					<c:forEach var="result" items="${resultList }" varStatus="status">
						<tr>
							<td>${result.dailyDate }</td>
							<td>${result.sludgeVolm }</td>
							<td>${result.sludgeComp }</td>
							<td>${result.sludgeCost }</td>
						</tr>
					</c:forEach>
					<c:if test="${empty resultList }">
						<tr><td colspan="4">데이터가 없습니다</td></tr>
					</c:if>
					</tbody>
				</table>
			</div><!--//table_wrap-->
	</div><!--//container_area-->
</div>
	<!-- contents e -->
<jsp:include page="../include/footer.jsp" />